package com.ilovepostcard.controller.server;

import java.util.HashMap;

import com.ilovepostcard.R;

/* check the interface document for detail rules */
public final class ServerSpec {
    
    
    public static final class ResultBase {
        public static final String METHOD = "method";
        public static final String RESULT = "result";
        public static final String ERROR_MSG = "errormsg";
        public static final String DATA = "data";
    }
    
    public static final class SexType {
        public static final int UNKNOWN = 0;
        public static final int MALE = 1;
        public static final int FEMALE = 2;
    }
    
    /**
    <pre>
    {
       "method": "OnUserLoginResult",
      "result": 0,  //成功时返回userid, userid > 0
                    //失败或异常时返回0
                    //-1,用户不存在
                    //-2,密码不正确
                    //-3,用户被锁定（不能登陆）
      "errormsg": "系统出现异常", //失败时的错误提示信息
      "data": {
      }

     }
   </pre>
   */
    public static final class UserLogin {
        /* action name */
        public static final String ACTION = "UserLogin";
        public static final String RESULT_METHOD = "OnUserLoginResult";
        
        /* parameter */
        public static final String PARAM_UNAME_URLENCODE = "uname";
        public static final String PARAM_PWD = "pwd";
        
        /* errors */
        public static final HashMap<Integer, Integer> ERRORS = new HashMap<Integer, Integer>();
        static {
            ERRORS.put(-1, R.string.error_user_not_exist);
            ERRORS.put(-2, R.string.error_pwd_not_correct);
            ERRORS.put(-3, R.string.error_user_locked);
        }
    }
    
    /**
    <pre>
         {
          "method": "OnUserRegisterResult",
          "result": 0,  //注册成功时返回userid, userid > 0
                        //失败或异常时返回0
                        //-1,用户名已存在
                        //-2,昵称已存在
          "errormsg": "", //请求失败时的错误消息
          "data": {
          }
        }
     </pre>
     */
    public static final class UserRegister {
        /* action name */
        public static final String ACTION = "UserRegister";
        public static final String RESULT_METHOD = "OnUserRegisterResult";
        
        /* parameter */
        public static final String PARAM_UNAME_URLENCODE = "uname";
        public static final String PARAM_PWD = "pwd";
        public static final String PARAM_NICK_NAME_URLENCODE = "nickname";
        
        /* errors */
        public static final HashMap<Integer, Integer> ERRORS = new HashMap<Integer, Integer>();
        static {
            ERRORS.put(-1, R.string.error_user_registed);
            ERRORS.put(-2, R.string.error_nickname_registed);
        }
    }
    
    
    /**
     * <pre>
        {
          "method": "OnUserLoginResult",
          "result": 0,  //成功时返回userid, userid > 0
                        //失败或异常时返回0
                        //-3,用户被锁定（不能登陆）
          "errormsg": "系统出现异常", //失败时的错误提示信息
          "data": {
          }
        }
        </pre>
     */
    public static final class UserLoginFromOpen {
        /* action name */
        public static final String ACTION = "UserLoginFromOpen";
        public static final String RESULT_METHOD = "OnUserLoginResult";
        
        /* parameter */
        public static final String PARAM_UNAME_URLENCODE = "uname";
        public static final String PARAM_NICK_NAME_URLENCODE = "nickname";
        public static final String PARAM_TYPE = "type";
        
        /* errors */
        public static final HashMap<Integer, Integer> ERRORS = new HashMap<Integer, Integer>();
        static {
            ERRORS.put(-3, R.string.error_user_locked);
        }
    }
    
    /**
    <pre>
         {
          "method": "OnGetUserInfoResult",
          "result": 0,  //1,成功；0,失败；-1,用户不存在
          "errormsg": "", //失败时的错误信息
          "data": { 
            "UserID": 0,         //用户ID，类型：Int64
            "Username": "",       //用户名，类型：String
            "Nickname": "",       //昵称，类型：String
            "IsValidEmail": true,   //邮箱是否已验证，类型：Boolean
            "HasHeadImg": false,        //是否拥有头像(标识用户是否上传过头像) ，类型：Boolean
            "HeadImgUrl": "",      //头像地址（无论是否拥有头像，头像地址都会返回），类型：String
            "Status": 1,         //用户状态(1,正常；2,锁定) ，类型：Int32
            "MyAttentionCount": 0,   //我关注的人数，类型：Int32
            "BeAttentionCount": 0,   //关注我的人数，类型：Int32
            "PublishCount": 0,       //创作的明信片数量，类型：Int32
            "PlatformType": 1,    开放平台类型，1=新浪，2=QQ
            "Introduction": "", //自我介绍，类型：String
            "MySpace": "",  //个人空间URL，类型：String
            "Sex": "", //性别，类型：Int32；0,未知；1,男；2,女；
            "Birthday":"", //生日（没有设置生日时为空字符串），类型：String
            "Province":"", //省份
            "City":""      //城市
              }
        }
     </pre>
     */
    public static final class GetUserInfo {
        /* action name */
        public static final String ACTION = "GetUserInfo";
        public static final String RESULT_METHOD = "OnGetUserInfoResult";
        
        /* parameter */
        public static final String PARAM_UNAME_URLENCODE = "uname";
        public static final String PARAM_UID = "uid";
        
        /* errors */
        public static final HashMap<Integer, Integer> ERRORS = new HashMap<Integer, Integer>();
        static {
            ERRORS.put(-1, R.string.error_user_not_exist);
        }
    }
    
    /**
    <pre>
         {
              "method": "OnGetMyPostcardResult",
              "result": 0,        //1,成功；0,失败
              "errormsg": "",    //失败时的错误消息
              "data": [
                {
                "PostcardID": 0, //明信片ID, 类型：Int64
                "Longitude": 0, //经度，类型：Double
                "Latitude": 0, //维度，类型：Double
                "ToFriendWords": "", //寄语，类型：String
                "Story": "", //故事，类型：String
                "PublishTime": "2012-03-23 21:12:53 ", //发布时间，类型：DateTime
                "Likes": 0, //喜欢的人数，类型：Int32
                "Comments": 0, //评论的次数，类型：Int32
                "Favorite": 0, //收藏的次数，类型：Int32
                "IsShowWords": true, //是否公开寄语，类型：Boolean
                "UserID": 0, //发布用户ID，类型：Int64
                “IsHorizontal”:true, //true表示图片是横图，false表示图片是竖图
                "ThumImgUrl": "", 缩略图URL，类型：String
                "PerviewImgUrl": "", //预览图URL，类型：String
                "ViewPermission": 0, //是否公开(0=公开，1=不公开)，类型：Int32
                "LocationPermission": 1, //是否显示位置(0=公开，1=不公开)，类型：Int32
                "TagIn": "" //标签，多个标签用逗号分隔（如：风景,人物,创意），类型：String
            },
            {..}
              ]
            }
     </pre>
     */
    public static final class GetPostcard {
        /* action name */
        public static final String ACTION_MY = "GetMyPostcard";
        public static final String ACTION_RECOMMEND = "GetHotPostcard";
        public static final String ACTION_FRIEND = "GetFriendsPostcard";
        public static final String ACTION_SEARCH_POSTCARD = "SearchPostcard";
        public static final String RESULT_METHOD_MY = "OnGetMyPostcardResult";
        public static final String RESULT_METHOD_RECOMMEND = "OnGetHotPostcardResult";
        public static final String RESULT_METHOD_FRIEND = "OnGetFriendsPostcardResult";
        public static final String RESULT_METHOD_SEARCH_POSTCARD = "OnSearchPostcardResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_PI = "pi";
        public static final String PARAM_PC = "pc";
        public static final String PARAM_K_URLENCODE = "k";
    }
    
    /**
     <PRE>
                        获取文件上传的验证序列号(GetUploadSKey)
                         请求  action.aspx?do=GetUploadSKey
                        响应  {
              "method": "OnGetUploadSKeyResult",
              "result": 0,  //1,成功；0,失败
              "errormsg": "", //请求失败时的错误消息
              "data": {
                "Key": "",         //验证序列号，32位字符串
              }
            }

     </PRE>
     */
    public static final class GetUploadSKey {
        /* action name */
        public static final String ACTION = "GetUploadSKey";
        public static final String RESULT_METHOD = "OnGetUploadSKeyResult";
    }
    
    
    /**
     <pre>
     上传文件(UploadFile)
请求  action.aspx?do=UploadFile&type=&filename=&skey=&uid=&x=&y=&w=&h=&r=
参数：
   type：上传的文件类型（1:用户头像；2：明信片图片）
   filename：上传的文件名(如：photo1.jpg)
   skey：验证序列号
   uid: 用户ID
   x: 切图的起始X坐标，类型：Int32，必须大于0
   y: 切图的起始Y坐标，类型：Int32，必须大于0
   w: 切图的宽度，类型：Int32，必须大于0
   h: 切图的高度，类型：Int32，必须大于0
   r: 图片旋转参数，类型：Int32，值为0、90、180、270
其它:
每次只能上传一个文件，文件内容通过POST内容传递二进制数据
响应  {
  "method": "OnGetUploadSKeyResult",
  "result": 0,  //1,成功；0,失败；
  "errormsg": "", //失败时的错误消息
  "data": {
  }
}
     </pre>
     */
    public static final class UploadFile {
        /* action name */
        public static final String ACTION = "UploadFile";
        public static final String RESULT_METHOD = "OnGetUploadSKeyResult";
        
        /* parameter */
        public static final String PARAM_TYPE = "type";
        public static final String PARAM_FILENAME = "filename";
        public static final String PARAM_SKEY = "skey";
        public static final String PARAM_UID = "uid";
        public static final String PARAM_X = "x";
        public static final String PARAM_Y = "y";
        public static final String PARAM_W = "w";
        public static final String PARAM_H = "h";
        public static final String PARAM_R = "r";
    }
    
    /**
     <pre>
{
  "method": "OnUpdateUserInfoResult",
  "result": 0,  //1,可以；2,不可以；0,失败
  "errormsg": "", //失败时的错误信息
  "data": {
  }
}
    </pre>
     */
    public static class CanModifyNickname {
        /* action name */
        public static final String ACTION = "CanModifyNickname";
        public static final String RESULT_METHOD = "OnUpdateUserInfoResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
    }
    
    /**
    <pre>
action.aspx?do=UpdateUserInfo&uid=&sex=&birthday=&province=&city=&introduction=&nickname=
参数：
   uid: 用户ID，类型：Int64
   sex: 性别，类型：Int32（0=保密，1=男，2=女）
   birthday: 生日，类型：String（固定8位长度字符串，如：19800130）
   province: 省份，类型：String（如：四川省）
   city: 城市，类型：String（如：成都市）
   introduction: 一句话介绍，类型：String（60个字符以内，1个中文算2个字符）
   nickname：昵称(如果不修改昵称传空字符串)，类型：String(20个字符以内，1个中文算2个字符)

{
  "method": "OnUpdateUserInfoResult",
  "result": 0,  //1,成功；0,失败；-1,昵称不能修改多次；-2,昵称已存在
  "errormsg": "", //失败时的错误信息
  "data": {
  }
}

    </pre>
     */
    public static class UpdateUserInfo {
        /* action name */
        public static final String ACTION = "UpdateUserInfo";
        public static final String RESULT_METHOD = "OnUpdateUserInfoResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_SEX = "sex";
        public static final String PARAM_BIRTHDAY = "birthday";
        public static final String PARAM_PROVINCE = "province";
        public static final String PARAM_CITY = "city";
        public static final String PARAM_INTRODUCTION_URLENCODE = "introduction";
        public static final String PARAM_NICKNAME_URLENCODE = "nickname";
        
        /* errors */
        public static final HashMap<Integer, Integer> ERRORS = new HashMap<Integer, Integer>();
        static {
            ERRORS.put(-1, R.string.error_cannot_modify_nick);
            ERRORS.put(-2, R.string.error_nickname_registed);
        }
    }
    
    
    /**
     <pre>
action.aspx?do=ListCity
{
  "method": "OnListCityResult",
  "result": 0,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": [{“Name”:”省份”,”CityItems”:[“城市”,”城市” ,”城市”]},
         {“Name”:”省份”,”CityItems”:[“城市”,”城市” ,”城市”]},
         {“Name”:”省份”,”CityItems”:[“城市”,”城市” ,”城市”]}
  ]
}
</pre>
     */
    public static class ListCity {
        /* action name */
        public static final String ACTION = "ListCity";
        public static final String RESULT_METHOD = "OnListCityResult";
    }
    
    /**
<pre>
action.aspx?do=CreatePostcard&uid=&location=&tofriendwords=&story=&isshowwords=&latitude=&longitude=&skey=&view_permission=&location_permission=&tags=
参数：
   uid：用户ID，类型：Int64
   location：位置，使用Url编码，类型：String，如：上海市真北路1200号
   tofriendwords：寄语，使用Url编码，类型：String
   story：故事，使用Url编码，类型：String
   isshowwords：是否显示寄语（0,显示；1,不显示；），类型：Int32
   latitude：纬度，类型：Double
   longitude：经度，类型：Double
   skey：验证序列号，类型：String
   view_permission：是否公开(0=公开，1=不公开)，类型：Int32
   location_permission：是否显示位置(0=公开，1=不公开)，类型：Int32
   tags：标签，多个标签用逗号分隔（如：风景,人物,创意），类型：String
{
  "method": "OnCreatePostcardResult",
  "result": 0,  //成功时返回明信片ID, ID > 0
                //失败时返回0
  "errormsg": "",  //失败时的错误消息
  "data": {
  }
}

</pre>
     */
    public static class CreatePostcard {
        /* action name */
        public static final String ACTION = "CreatePostcard";
        public static final String RESULT_METHOD = "OnCreatePostcardResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_LOCATION_URLENCODE = "location";
        public static final String PARAM_TO_FRIEND_WORDS_URLENCODE = "tofriendwords";
        public static final String PARAM_STORY_URLENCODE = "story";
        public static final String PARAM_IS_SHOW_WORDS = "isshowwords";
        public static final String PARAM_LATITUDE = "latitude";
        public static final String PARAM_LONGITUDE = "longitude";
        public static final String PARAM_SKEY = "skey";
        public static final String PARAM_VIEW_PERMISSION = "view_permission";
        public static final String PARAM_LOCATION_PERMISSION = "location_permission";
        public static final String PARAM_TAGS = "tags";
    }
    
    
    /**
<pre>
action.aspx?do=DeletePostcard&pid=&uid=
参数：
   pid：明信片ID，类型：Int64
   uid：用户ID，类型：Int64
{
  "method": "OnDeletePostcardResult",
  "result": 0,  //成功时返回1
                //失败时返回0
  "errormsg": "",  //失败时的错误消息
  "data": {
  }
}
</pre>
     */
    public static final class DeletePostcard {
        /* action name */
        public static final String ACTION = "DeletePostcard";
        public static final String RESULT_METHOD = "OnDeletePostcardResult";
        
        /* parameter */
        public static final String PARAM_PID = "pid";
        public static final String PARAM_UID = "uid";
    }
    
    /**
<pre>
action.aspx?do=PostProposal&uid=&body=
参数：
   uid: 用户ID
   body: 明信片ID，类型：String（最多500个字符，1个中文算2个字符）
{
  "method": "OnPostProposalResult",
  "result": 0,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": {
  }
}
</pre>
     */
    public static final class PostProposal {
        /* action name */
        public static final String ACTION = "PostProposal";
        public static final String RESULT_METHOD = "OnPostProposalResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_BODY_URLENCODE = "body";
    }
    
    /**
<pre>
action.aspx?do=CheckNew&ver=
参数：
   Ver：当前客户端版本号，类型：String，如：1.0.0
{
  "method": "OnCheckNewResult",
  "result": 0,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": {
    “HasNewVersion”:true  //是否有新版本，类型：Boolean
“Version”:”1.0.1”,  //最新版本号，类型：String
”Url”:”http://www.ilovepostcard.com/mxp.apk”,  //下载地址，类型：String
“Note”:””  //更新说明，类型：String
}
}
</pre>
     */
    public static class CheckNew {
        /* action name */
        public static final String ACTION = "CheckNew";
        public static final String RESULT_METHOD = "OnCheckNewResult";
        
        /* parameter */
        public static final String PARAM_VER = "ver";
        public static final String PARAM_CHANNEL = "channel";
    }
    
    /**
<pre>
action.aspx?do=Attention&uid1=&uid2=&type=
参数：
   uid1：我的ID，类型：Int64
   uid2：对方的ID，类型：Int64
   type：操作类型(1=关注，2=取消关注)，类型：Int32
{
  "method": "OnAttentionResult",
  "result": 0,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data":""
}

</pre>
     */
    public static class Attention {
        /* action name */
        public static final String ACTION = "Attention";
        public static final String RESULT_METHOD = "OnAttentionResult";
        
        /* parameter */
        public static final String PARAM_UID_MY = "uid1";
        public static final String PARAM_UID_OTHER = "uid2";
        public static final String PARAM_TYPE = "type";
    }
    
    /**
<pre>
action.aspx?do=CheckAttention&uid1=&uid2=
参数：
   uid1：我的ID，类型：Int64
   uid2：对方的ID，类型：Int64
{
  "method": "OnCheckAttentionResult",
  "result": 0,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data":true    //true:已关注对方，false:未关注对方
}

</pre>
     */
    public static class CheckAttention {
        /* action name */
        public static final String ACTION = "CheckAttention";
        public static final String RESULT_METHOD = "OnCheckAttentionResult";
        
        /* parameter */
        public static final String PARAM_UID_MY = "uid1";
        public static final String PARAM_UID_OTHER = "uid2";
    }
    
    /**
<pre>
action.aspx?do=GetAttentionList&uid=&type=&pi=&pc=
参数：
   uid：我的ID，类型：Int64
   type：关注类型(1=我关注，2=关注我)，类型：Int32
   pi: 分页索引，从1开始
   pc: 每页的记录数
{
  "method": "OnGetAttentionListResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data" :[
{"UserID":10415,"Nickname":"小黑","LastPublishTime":"2012-01-01T00:00:00"},
{"UserID":10143,"Nickname":"sunnyyo","LastPublishTime":"2012-08-16T19:12:54"},
{"UserID":10103,"Nickname":"Qiang","LastPublishTime":"2012-08-25T06:12:54.6"}
]
}

</pre>
     */
    public static class GetAttentionList {
        /* action name */
        public static final String ACTION = "GetAttentionList";
        public static final String RESULT_METHOD = "OnGetAttentionListResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_TYPE = "type";
        public static final String PARAM_PI = "pi";
        public static final String PARAM_PC = "pc";
    }
    
    /**
<pre>
action.aspx?do=GetPostcardInfo&postcardid=
参数：
   postcardid：明信片ID，类型：Int64 
{
  "method": "OnGetPostcardInfoResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data" : {
    …
}
}

说明：
“data” 属性包含返回的数据，数据结构见“3.3. PostcardItem结构”
</pre
     */
    public static class GetPostcardInfo {
        /* action name */
        public static final String ACTION = "GetPostcardInfo";
        public static final String RESULT_METHOD = "OnGetPostcardInfoResult";
        
        /* parameter */
        public static final String PARAM_PID = "postcardid";
    }
    
    /**
<pre>
action.aspx?do=GetUserActiveTime&uid=
参数：
   uid：用户ID，类型：Int64 
{
  "method": "OnGetUserActiveTimeResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data" :{
"UserID":10415,  //用户ID
"ActiveTime":"2012-08-14T10:47:31.337"  //活跃时间
}
}

</pre>
     */
    public static class GetUserActiveTime {
        /* action name */
        public static final String ACTION = "GetUserActiveTime";
        public static final String RESULT_METHOD = "OnGetUserActiveTimeResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
    }
    
    /**
<pre>
action.aspx?do=LikePostcard&uid=&postcardid=
参数：
   uid：用户ID，类型：Int64 
   postcardid：明信片ID，类型：Int64
{
  "method": "OnLikePostcardResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data":""
}

</pre>
     */
    public static class LikePostcard {
        /* action name */
        public static final String ACTION = "LikePostcard";
        public static final String RESULT_METHOD = "OnLikePostcardResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_POSTCARDID = "postcardid";
    }
    
    /**
<pre>
action.aspx?do=NewPostcardComment&uid=&postcardid=&body=
参数：
   uid：用户ID，类型：Int64
   postcardid：明信片ID，类型：Int64
   body：评论内容（需要使用UrlEncode编码），类型：String
{
  "method": "OnNewPostcardCommentResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data":""
}
</pre>
     */
    public static class NewPostcardComment {
        /* action name */
        public static final String ACTION = "NewPostcardComment";
        public static final String RESULT_METHOD = "OnNewPostcardCommentResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_POSTCARDID = "postcardid";
        public static final String PARAM_BODY_URLENCODE = "body";
    }
    
    /**
<pre>
action.aspx?do=GetPostcardComments&postcardid=&pi=&pc=
参数：
   postcardid：明信片ID，类型：Int64
   pi: 分页索引，从1开始
   pc: 每页的记录数
{
  "method": "OnGetPostcardCommentsResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data ":{
"TotalCount":12,
"Items":[
{"CommentID":30,
"UserID":10415,
"Nickname":"小黑",
"CreatedTime":"2012-09-23T21:34:36.907",
"Body":"111111111111111"},
{"CommentID":29,
"UserID":10415,
"Nickname":"小黑",
"CreatedTime":"2012-09-23T21:03:53.917",
"Body":"111111111111555"},
{…}
    ]}
}
</pre>
     */
    public static class GetPostcardComments {
        /* action name */
        public static final String ACTION = "GetPostcardComments";
        public static final String RESULT_METHOD = "OnGetPostcardCommentsResult";
        
        /* parameter */
        public static final String PARAM_POSTCARDID = "postcardid";
        public static final String PARAM_PI = "pi";
        public static final String PARAM_PC = "pc";
    }
    
    /**
<pre>
action.aspx?do=SearchUser&k=&pi=&pc=
参数：
   k：搜索的关键字（需要使用UrlEncode编码），类型：String
   pi: 分页索引，从1开始
   pc: 每页的记录数
{
  "method": "OnSearchUserResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data":[
{ …},
{…}
  ]
}

说明：
“data”中包含数据集合，其单一数据结构同GetUserInfo接口。
</pre>
     */
    public static class SearchUser {
        /* action name */
        public static final String ACTION = "SearchUser";
        public static final String RESULT_METHOD = "OnSearchUserResult";
        
        /* parameter */
        public static final String PARAM_K_URLENCODE = "k";
        public static final String PARAM_PI = "pi";
        public static final String PARAM_PC = "pc";
    }
    
    /**
<pre>
action.aspx?do=GetNewMessageCount&uid=
参数：
   uid: 用户ID 
{
  "method": "OnGetNewMessageCountResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": 0  //未读的消息数量，类型：Int32
}
<pre>
     */
    public static class GetNewMessageCount {
        /* action name */
        public static final String ACTION = "GetNewMessageCount";
        public static final String RESULT_METHOD = "OnGetNewMessageCountResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
    }
    
    /**
<pre>
action.aspx?do=DeleteMessage&uid=&mid=
参数：
   uid: 用户ID
   mid: 消息ID
{
  "method": "OnDeleteMessageResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": {}
}
</pre>
     */
    public static class DeleteMessage {
        /* action name */
        public static final String ACTION = "DeleteMessage";
        public static final String RESULT_METHOD = "OnDeleteMessageResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_MID = "mid";
    }
    
    /**
<pre>
action.aspx?do=ListMessage&uid=&pi=&pc=
参数：
   uid: 用户ID
   pi: 分页索引，从1开始
   pc: 每页的记录数
{
  "method": "OnListMessageResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": [
{…},
{…}
  ]
}

说明：
“data”中包含数据集合，其结构如下
"MessageID":1,  //消息ID
"SenderID":1,   //来源用户ID
"SenderName":"1",  //来源用户昵称
"MessageType":1,   //消息类型（1=用户关注，2=明信片被攒，3=明信片被评论）
"CreatedTime":"2012-10-13T16:21:51.61",  //消息发送时间
"ReceiverID":2,    //消息接收者ID
"Memo":"",    //备注信息（MessageType=3时有效，为评论内容）
"PostcardID":10,  //明信片ID（MessageType=2 or 3时有效，明信片ID）
"IsRead":false,  //消息是否已被阅读
"ReadTime":"1900-01-01T00:00:00”   //消息阅读时间
</pre>
     */
    public static class ListMessage {
        /* action name */
        public static final String ACTION = "ListMessage";
        public static final String RESULT_METHOD = "OnListMessageResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_PI = "pi";
        public static final String PARAM_PC = "pc";
    }
    
    /**
<pre>
action.aspx?do=GetUserHeadImg&uid=
参数：
   uid: 用户ID
{
  "method": "OnGetUserHeadImgResult",
  "result": 0,  //1,成功；0,失败
  "errormsg": "", 
  "data": {
    "Url": "",         //头像URL，如：http://www.a1.com/101.jpg
  }
}
</pre>
     */
    public static class GetUserHeadImg {
        /* action name */
        public static final String ACTION = "GetUserHeadImg";
        public static final String RESULT_METHOD = "OnGetUserHeadImgResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
    }
    
    /**
<pre>
action.aspx?do=ListAddress&uid=&pi=&pc=
参数：
   uid: 用户ID
   pi: 分页索引，从1开始
   pc: 每页的记录数
{
  "method": "OnListAddressResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": [
{…},
{…}
  ]
}

说明：
“data” 属性包含返回的数据集合，单条数据结构见“3.2. AddressItem结构”
</pre>
     */
    public static class ListAddress {
        /* action name */
        public static final String ACTION = "ListAddress";
        public static final String RESULT_METHOD = "OnListAddressResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_PI = "pi";
        public static final String PARAM_PC = "pc";
    }
    
    /**
<pre>
action.aspx?do=NewAddress&uid=&name=&telephone=&province=&city=&address=&zipcode=
参数：
   uid: 用户ID
   name: 姓名
   telephone: 电话
   province: 省份
   city: 城市
   address: 详细地址
   zipcode: 邮编
{
  "method": "OnNewAddressResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": ""
}
</pre>
     */
    public static class NewAddress {
        /* action name */
        public static final String ACTION = "NewAddress";
        public static final String RESULT_METHOD = "OnNewAddressResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_NAME_URLENCODE = "name";
        public static final String PARAM_TELEPHONE_URLENCODE = "telephone";
        public static final String PARAM_PROVINCE = "province";
        public static final String PARAM_CITY = "city";
        public static final String PARAM_ADDRESS_URLENCODE = "address";
        public static final String PARAM_ZIPCODE = "zipcode";
    }
    
    /**
<pre>
action.aspx?do=NewOrder&type=&pids=&sendword=&aids=
参数：
   type: 订单类型(single=单张印制, suit=套装印制)
   pids: 明信片ID列表(单张印制时只能有1个ID，套装印制时为15个ID，多个ID之间使用逗号分隔)
   sendword: 明信片寄语
   aids: 寄送地址ID列表(单张印制时需要，套装印制时此参数不需要)

请求示例：
   单张印制请求URL：
http://localhost:4635/Action.aspx?do=NewOrder&type=suit&uid=10471&pids=245,246,247,248,249,250,251,252,253,254,255,256,257,258,259&sendword=abcdefg
   套装印制请求URL：
http://localhost:4635/Action.aspx?do=NewOrder&type=single&uid=10471&pids=255&sendword=abcdefg&aids=5,6,7
{
  "method": "OnNewOrderResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  “data": {
“OrderID”:”20121113221554”,  //订单ID
“PayUrl”:"http://www.kuukie.com/cart/?id=209545" //订单确认页面URL
  }
}

</pre>
     */
    public static class NewOrder {
        /* action name */
        public static final String ACTION = "NewOrder";
        public static final String RESULT_METHOD = "OnNewOrderResult";
        
        /* parameter */
        public static final String PARAM_TYPE = "type";
        public static final String PARAM_UID = "uid";
        public static final String PARAM_PIDS = "pids";
        public static final String PARAM_SENDWORD_URLENCODE = "sendword";
        public static final String PARAM_AIDS = "aids";
    }
    
    /**
<pre>
action.aspx?do=ListOrder&uid=&pi=&pc=
参数：
   uid: 用户ID
   pi: 分页索引，从1开始
   pc: 每页的记录数
{
  "method": "OnListOrderResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": [
{…},
{…}
  ]
}

说明：
“data”中包含数据集合，其结构如下
"ProductType":1,     //产品类型，1是单张印制，2是套装印制
"OrderID":"111111111",   //订单号
"UserID":10471,    //用户ID
"OrderTime":"2012-10-20T00:00:00",   //订单创建时间
"OrderStatus":1,    //订单状态(1=订单已生成，2=等待用户付款, 3=订单已取消,4=用户已付款，产品制作中, 5=订单制作完成，并已发货)
</pre>
     */
    public static class ListOrder {
        /* action name */
        public static final String ACTION = "ListOrder";
        public static final String RESULT_METHOD = "OnListOrderResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_PI = "pi";
        public static final String PARAM_PC = "pc";
    }
    
    /**
<pre>
action.aspx?do=GetOrderInfo&orderid=
参数：
   orderid: 订单ID
{
  "method": "OnListOrderResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": {
  }
}

说明：
“data”中包含数据集合，其结构如下
"ProductType":1,    //产品类型，1是单张印制，2是套装印制
"OrderID":"111111111",   //订单号
"UserID":10471,      //用户ID
"OrderTime":"2012-10-20T00:00:00",    //订单创建时间
"OrderStatus":1,     //订单状态(1=订单已生成，2=等待用户付款, 3=订单已取消,4=用户已付款，产品制作中, 5=订单制作完成，并已发货)
"Items":[    //”items”中是订单明细数据
{
"PostcardID":99999,    //明信片ID
"SendWord":"1111111",     //明信片寄语
"AddressID":0,    //不使用
"AddressName":"111"},      //收件人姓名
{…}
]

</pre>
     */
    public static class GetOrderInfo {
        /* action name */
        public static final String ACTION = "GetOrderInfo";
        public static final String RESULT_METHOD = "OnListOrderResult";
        
        /* parameter */
        public static final String PARAM_OID = "orderid";
    }
    
    /**
<pre>
action.aspx?do=CheckLike&uid=&postcardid=
参数：
   uid: 账号ID
   postcardid: 明信片ID
{
  "method": "OnCheckLikeResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": True   //是否已Like, True=已关注，False=未关注
}
</pre>
     */
    public static class CheckLike {
        /* action name */
        public static final String ACTION = "CheckLike";
        public static final String RESULT_METHOD = "OnCheckLikeResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_PID = "postcardid";
    }
    
    /**
<pre>
action.aspx?do=GetShareTextConfig
{
  "method": "OnGetShareTextConfigResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": [
"文本串1",
"文本串2",
"文本串3"
  ]
}

action.aspx?do=GetShareTextConfig&type=&uid=&pid=
参数：
   type: 1=［分享］文字, 2=［通过邮件寄送］文字, 3=［通过短信邀请朋友］, 4=［通过邮件邀请朋友］
   uid: 用户ID
   pid: 明信片ID
{
  "method": "OnGetShareTextConfigResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": {
“Title”:””,    //标题(type为1、3时Title为空，type为2、4时有内容)
“Body”:””,    //内容
“PostcardUrl”:””   //明信片URL
  }
}

</pre>
     */
    public static class GetShareTextConfig {
        /* action name */
        public static final String ACTION = "GetShareTextConfig";
        public static final String RESULT_METHOD = "OnGetShareTextConfigResult";
        
        /* parameter */
        public static final String PARAM_TYPE = "type";
        public static final String PARAM_UID = "uid";
        public static final String PARAM_PID = "pid";
    }
    
    
    /**
<pre>
action.aspx?do=GetLastPostcardComment&uid=&pid=
说明：获取用户对指定明信片发表的最后一条评论信息
参数：
   uid: 用户ID
   pid: 明信片ID
{
  "method": "OnGetLastPostcardCommentResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": {

  }
}

说明：
“data” 属性包含返回的数据，单条数据结构见“3.5. PostcardCommentItem结构”
</pre>
     */
    public static class GetLastPostcardComment {
        /* action name */
        public static final String ACTION = "GetLastPostcardComment";
        public static final String RESULT_METHOD = "OnGetLastPostcardCommentResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
        public static final String PARAM_PID = "pid";
    }
    
    /**
<pre>
action.aspx?do=GetBuycartUrl&uid=
参数：
   uid: 账号ID
{
  "method": "OnGetBuycartUrlResult",
  "result": 1,      //1,成功；0,失败
  "errormsg": "",   //失败时的错误消息
  "data": "http://www.kuukie.com/cart/?uid=lsmxp10605&lang=zh-cn"   //购物车URL
}
</pre>
     */
    public static class GetBuycartUrl {
        /* action name */
        public static final String ACTION = "GetBuycartUrl";
        public static final String RESULT_METHOD = "OnGetBuycartUrlResult";
        
        /* parameter */
        public static final String PARAM_UID = "uid";
    }
    
    
}
